# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=barf
pkgver=923.9547ef8
pkgrel=9
pkgdesc='A multiplatform open source Binary Analysis and Reverse engineering Framework.'
groups=('blackarch' 'blackarch-binary' 'blackarch-reversing')
arch=('any')
url='https://github.com/programa-stic/barf-project'
license=('BSD')
depends=('python' 'python-pygments' 'python-pyparsing' 'python-pydot'
         'python-pyelftools' 'python-capstone' 'python-ropper' 'ropgadget'
         'python-future' 'python-networkx' 'python-pefile')
makedepends=('git' 'python-setuptools')
source=("$pkgname::git+https://github.com/programa-stic/barf-project.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md MANIFEST.in \
    CHANGELOG.md doc/papers/*

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

